﻿using System;
using NUnit.Framework;
using ThoughtWorks.CruiseControl.Core.tasks.Conditions.DateTimeHelpers;


namespace CCNet.Conditional.Plugin.Test.Conditions
{
    [TestFixture]
    public class TimePeriodTest
    {
        [Test]
        [Description("parsing succedes")]
        [Category("parsing")]
        public void TimePeriodTest_parsing_succedes(
            [Values("00:00-24:00","00:00-00:01","23:00-01:00","12:00-12:00")]string format
            )
        {
            TimePeriod period = format;
            Assert.That(period.ToString(), Is.EqualTo(format));
        }

        [Test]
        [Description("parsing fail")]
        [Category("parsing")]
        [ExpectedException(typeof(ArgumentException))]
        public void TimePeriodTest_parsing_fail(
            [Values("None timeperiod string", ":00-24:00", "00:00-:01", "23:00", "12:00-24:01")]string format
            )
        {
            TimePeriod period = format;
            Assert.That(period.ToString(), Is.EqualTo(format));
        }


    }
}
